Component({
    /**
     * 组件的属性列表
     */
    properties: {
        datas: {
            type: Object,
        },
        currentMenu: {
            type: Object,
        },
        sex: String,
        answeUserName: String,
    },

    /**
     * 组件的初始数据
     */

    data: {
        createTime: '',
    },

    /**
     * 组件的方法列表
     */
    methods: {
        formatCreateTime() {
            const createTime = this.datas.createTime
            const formattedDate = createTime.split(' ')[0] // 提取日期部分
            this.setData({
                createTime,
            })
        },

        handelTapReport(e) {
            console.log('handelTapReport e :>> ', e);
            wx.navigateTo({
                url: `/pages/report-detail/index?id=${this.data.datas.reportProcessId}`,
            })
        },

        handelTapDialog() {
            const { userId } = JSON.parse(wx.getStorageSync('userInfo'))
            const { title, menuId } = this.data.currentMenu
            wx.navigateTo({
                url: `/pages/channel/index?title=${title}&menuId=${menuId}&userId=${userId}&answeUserId=${this.data.datas.answeUserId}&id=${this.data.datas.id}`,
            })
        },
        lifetimes: {
            attached() {
                // 在组件实例进入页面节点树时执行
                this.formatCreateTime() // 调用格式化日期的方法
            },
        },
    },
})